import BaseUrl from "../BaseUrl"
import myaxios from "../MyAxios"

let { HYRJURL, UPLOADURL } = BaseUrl
const activityApi = {

    /**
     * 查询活动
     * @param {object} params 
     * {page:1,pagesize:10} 必填
     */
    queryList(params) {
        let url = HYRJURL + `/activityList?`
        return myaxios.get(url, params)
    },

    /**
     * 活动名称模糊查询
     * @param {object} params 
     * {name:名称，page:1,pagesize:10}
     */
    queryNameList(params) {
        let url = HYRJURL + `/activityNameList`
        return myaxios.get(url, params)
    },

    /**
     * ID查询活动
     * @param {object} params 
     * {id:活动id，page:string,pagesize:string}
     */
    queryIdList(params) {
        let url = HYRJURL + '/activityIdList'
        return myaxios.get(url, params)
    },



    /**
     * 添加活动
     * @param {object} params 
     * {id:null(必填),name:string(必填),pic:string,plce:string,longtude:string,latitude:string,StartDate:string,EndDater}
     */
    activityAdd(params) {
        let url = HYRJURL + '/activityListAdd'
        return myaxios.post(url, params)
    },

    /**
     * 修改活动
     * @param {object} params 
     * {id:值(必填),name:string,pic:string,plce:string,longtude:string,latitude:string,StartDate:string,EndDater}
     */
    activityUpdate(params) {
        let url = HYRJURL + '/activityUpdateList'
        return myaxios.post(url, params)
    },

    /**
     * 删除活动列表
     * @param {object} params
     * {id:参数值} 
     */
    activityDelete(params) {
        let url = HYRJURL + '/activityDelete'
        return myaxios.get(url, params)
    },

    /**
     * 通过活动id查询作品列表
     * @param {object} params
     * {ActiveityId:活动id，page：1，pagesize：10} 
     */
    qureyWorkList(params) {
        let url = HYRJURL + '/flower_show_list'
        return myaxios.get(url, params)
    },

    /**
     * 通过作品名称模糊查询
     * @param {object} params 
     * {ActiveityId:活动ID(必填),work_list_title:作品标题(必填),page:1,pagesize:10,}
     */
    queryWorkNameList(params) {
        let url = HYRJURL + '/flower_show_pagingQuery'
        return myaxios.get(url, params)
    },

    /**
     * 通过作品id查询
     * @param {object} params
     * {workId:string(必填)} 
     */
    queryWorkIdList(params) {
        let url = HYRJURL + '/flower_show_queryWorkIdList'
        return myaxios.get(url, params)
    },


    /**
     * 添加活动作品
     * @param {object} params
     * {workId：null，uid：用户id，nickname：用户昵称，work_list_cover：图片路径，work_list_title:标题,work_list_describe:简介,work_list_date:时间戳,work_list_vote：票数} 
     */
    queryWorkAdd(params) {
        let url = HYRJURL + '/flower_show_add'
        return myaxios.post(url, params)
    },

    /**
     * 删除作品
     * @param {object} params 
     * {workId:作品id}
     */
    workDelete(params) {
        let url = HYRJURL + '/flower_show_delete'
        return myaxios.get(url, params)
    },

    /**
     * 修改作品
     * @param {object} params
     * {work_list_cover:string(可选),work_list_title:string(可选),work_list_describe:string(可选)} 
     */
    workUpdate(params) {
        let url = HYRJURL + '/flower_show_Update'
        return myaxios.post(url, params)
    },
    

    /**
     * 活动作品详情
     * @param {object} params
     * {work_list_cover:string(可选),work_list_title:string(可选),work_list_describe:string(可选)} 
     */
    workDetail(params) {
        let url = HYRJURL + '/flower_show_detail'
        return myaxios.get(url, params)
    }, 
    
    

    /**
     * 活动作品详情修改
     * @param {object} params
     * {work_list_cover:string(可选),work_list_title:string(可选),work_list_describe:string(可选)} 
     */
    workUpDetail(params) {
        let url = HYRJURL + '/flower_show_Updetail'
        return myaxios.post(url, params)
    }, 
}


export default activityApi